The formation of precipitates or emulsions in crude oil during extraction and refinement may present problems, such as the slowing or complete cessation of oil flow. Removal of these precipitates is often difficult, expensive and hazardous to human health. The formation of stabilized emulsions delays the production of oil for future sale and use, and also has a deleterious effect on the quality of the oil. Overall, the formation of precipitates and emulsions in crude oil decreases the efficiency of extraction and refinement processes.
The formation of precipitates or emulsions in crude oil generally results from the reaction of metal cations with indigenous naphthenic acids. In this context, naphthenic acids are generally considered to be complex mixtures of alkyl-substituted acyclic and cyclic carboxylic acids that are generated from in-reservoir biodegradation of petroleum hydrocarbons. They are normal constituents of nearly all crude oils and are typically present in amounts of up to 4% by weight. They are predominantly found in immature heavy crudes, whereas paraffinic crudes normally have lower naphthenic acid contents. Metal cations found in crude oil that are involved in precipitate and emulsion formation include alkali and alkali-earth metals such as sodium, potassium, calcium and magnesium. Transition metals such as iron may also be involved.
There are two common types of precipitate/emulsion that are formed as a result of the reaction between metal ions and naphthenic acids in crude oil:
(1) Calcium Naphthenates
These are generated from heavy crude oils with high levels of carboxylic acids and are formed as a result of a reaction between a naphthenic acid and a calcium cation. The properties of calcium naphthenates pose unique challenges in terms of flow assurance such as:                plugging of chokes, valves, pumps and vessel internals;        blocking of water legs in separators due to migration into the water phase;        unplanned shutdowns due to hardened deposits causing blockages;        disposal issues due to presence of heavy metals which can lead to high NORM activity;        negative impact on water quality due to an increased oil content in the separated water; and        negative impact on injection/disposal well performance.(2) Sodium Carboxylates        
These are generated by the reaction of monocarboxylic acids in crude oil and sodium ions in the water phase and are often referred to as carboxylate soaps. They produce flow assurance challenges that are different to calcium naphthenates, in particular:                they form ultra stable viscous emulsions which accumulate at the interface of the oil and water components in a separator thereby reducing the residence time and efficiency of separation;        sludges of carboxylate soaps can reduce storage and export tank capacity making it difficult for removal from the tanks;        toxic sludges may be produced; and        oil-wet soap particles may be discharged in the separated water.        
It is recognised that naphthenic acid salts, commonly referred to as “soaps” in the oil industry, are present in a variety of hydrocarbon sources. The issue is predicated by high Total Acid Number (TAN), indicating significant amounts of naphthenic acid specified by the general formula R—COOH, but more specifically described in the literature as carboxylic acids of cyclic and acyclic types as noted above. The naphthenic acids may be further subdivided between naphthenic acids causing calcium naphthenate solids and sodium carboxylate solids.
When exposed to precise conditions, naphthenic acids partition from the oil phase to the aqueous phase. The main factors believed to play a role in “soap” formation can be divided into production chemistry issues of crude oil composition, production water and pH variations and physical parameters such as pressure, temperature, co-mingling of fluids, shear, and water-cut. The partitioning of naphthenic acids under precise conditions may lead to production problems, including solids formation and emulsification, at the reservoir wellbore interface and throughout the surface facilities, such as pipelines and separators (i.e. as listed above).
Once such particulate matter is formed in porous media, formation damage may occur through change in wettability and permeability impairment by various mechanisms. Particularly, a tight emulsion incorporating solids as discussed above may be formed and move along the interface during fluid flow in the reservoir porous medium and may be captured at the pore throats where the flow area is constricted and wettability shift may occur. The formation of sodium carboxylate soaps and their subsequent precipitation in the porous medium may cause major formation damage problems in the production of naphthenic acid containing crude oils.
Sodium carboxylate “soaps” are formed by contact of acidic crude oil with high pH brine or similar aqueous media. Sources of water effective in naphthenate soap formation include the connate water present in the reservoir, water injected for secondary recovery purposes, filtrate of water based mud invading the near-wellbore formation and completion fluids invading the near-wellbore formation, or the water entrained as a result of the water conning phenomenon. The prompting process for the formation of sodium carboxylate soap is the contact of acidic crude and fluid are described in the following.
With regard to the reaction chemistry within the system, the formation water is usually saturated with CO2 establishing an equilibrium under the reservoir pressure, temperature, and brine pH conditions. Carbon dioxide (CO2) contained in formation fluids in the reservoir controls the system pH. CO2 dissociates to bicarbonate and further into carbonic acid during production transmittal. As a result of pressure decreases, the pH of the water increases allowing the carboxylic acids in the crude oil to partition to some degree into the water phase where they may react with sodium cations to form soap. The change in pH is deemed a function of pressure decrease related to CO2 content in the crude oil.
Hence, the H+ concentration decreases and equilibrium shifts as the pressure drop triggers the degassing of CO2 during the flow of fluids under a pressure gradient, for example lifting from a high pressure well bore to a low pressured process facility. This reduction in the protons yields excess OH− and increases the pH in the water.
In the case of drilling fluid filtrate and completion fluid introduction, the connate water pH is increased by the introduction of highly buffered high pH fluids meant to prevent swelling of resident clays in the near wellbore-reservoir interface. This direct introduction leads to immediate excess OH− and increases the pH.